<%@page import="javax.naming.spi.DirStateFactory.Result"%>
<%@page import="bean.StudentInfo"%>
<%@page import="java.util.ArrayList"%>
<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>学生信息修改</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="catch-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
	<br>
	<h2>学生信息：</h2>
	<hr>
	<br>
	<h3>要修改的学生信息如下：</h3>
	<br>
	<table width="450" border="100" cellspacing="1"
		style="font-size: 15pt; border: dashed 1pt">
		<tr>
			<td>学号</td>
			<td>姓名</td>
			<td>年龄</td>
			<td>性别</td>
			<td>专业</td>
		</tr>
		<%
			int id = 0;
			ArrayList<StudentInfo> result = new ArrayList<StudentInfo>();
			result = (ArrayList<StudentInfo>) request.getAttribute("result");
			System.out.println(result);
			if (!result.isEmpty()) {
				for (int i = 0; i < result.size(); i++) {
					StudentInfo st = result.get(i);
					id = st.getId();
					out.print("<tr>");
					out.print("<td>" + st.getId() + "</td>");
					out.print("<td>" + st.getName() + "</td>");
					out.print("<td>" + st.getAge() + "</td>");
					out.print("<td>" + st.getGender() + "</td>");
					out.print("<td>" + st.getMajor() + "</td>");
					out.print("</tr>");
				}
			}
		%>
	</table>
	<h3>将学生信息更改为：</h3>
	<form action="ALLServlet" method="post">
		<input type="hidden" name="methodName" value="3" />
		<h4>
			学号： <input type="text" name="id" value="<%=id%>" title="学号不能改变"></input>
			<br>
		</h4>
		<h4>
			姓名： <input type="text" name="name" value="<%=id%>" title="姓名不能空"></input>
			<br>
		</h4>
		<h4>
			年龄：<input type="text" name="age" value="<%=id%>" title="年龄不能空"></input>
			<br>
		</h4>
		<h4>
			性别： <input type="radio" name="gender" value="男">男 <input
				type="radio" name="gender" value="女">女<br>
		</h4>
		<h4>
			专业： <input type="text" name="major" value="<%=id%>" title="专业不能空"></input>
			<br>
		</h4>
		<input type="submit" value="修改" />
	</form>
	<br>
	<h3>
		<a href="putin.jsp">返回信息输入页面</a>
	</h3>
	<a href=ALLServlet?methodName= <%=1%>&id=<%=""%> name=<%=""%>>返回信息查询页面</a>
	</h3>
</body>
</html>